home *** CD-ROM | disk | FTP | other *** search
/ Champak 145 / (Vol 145) Dec 21 2011.iso / Games / hanna-in-a-choppa.swf / scripts / DefineSprite_400 / frame_1 / DoAction.as
Encoding:
Text File  |  2011-12-21  |  1.1 KB  |  37 lines

  1. function checkValid()
  2. {
  3.    if(txtFeedback.text == defaultText || txtFeedback.text == "")
  4.    {
  5.       defaultText = "No no no, you\'re meant to write in this box. Over here!";
  6.       txtFeedback.text = defaultText;
  7.       return false;
  8.    }
  9.    return true;
  10. }
  11. stop();
  12. var objDatacap = new _root.Datacap("HannaInAChoppa_feedback","stf");
  13. objDatacap.registerTextbox("feedback",txtFeedback);
  14. objDatacap.setHiddenValue("email","noreply@deeperbeige.com");
  15. objDatacap.setHiddenValue("femail","hannainachoppa@deeperbeige.com");
  16. objDatacap.registerSubmit("submit",btnSubmit,"submit");
  17. objDatacap.registerFrames("sending","success","failure",this);
  18. objDatacap.registerCallbacks(checkValid);
  19. this.errFeedback._visible = false;
  20. defaultText = "Tap out some text here, then hit submit";
  21. txtFeedback.text = defaultText;
  22. txtFeedback.onSetFocus = function()
  23. {
  24.    if(txtFeedback.text == defaultText)
  25.    {
  26.       txtFeedback.text = "";
  27.    }
  28. };
  29. txtFeedback.onKillFocus = function()
  30. {
  31.    defaultText = "No no no, you\'re meant to write in this box. Over here!";
  32.    if(txtFeedback.text == "")
  33.    {
  34.       txtFeedback.text = defaultText;
  35.    }
  36. };
  37.